.web-preview {
	position: fixed;
		top: 0;
		right: 0;
		left: 0;
	margin: 0 auto;
	overflow: hidden;
	opacity: 0;
	z-index: z-index( 'root', '.web-preview' ); // Above TinyMCE dialogs
	transition: opacity 0.3s ease-in-out;

	&.is-visible {
		opacity: 1;
		bottom: 0;
		visibility: visible;

		.web-preview__content {
			opacity: 1;
			transform: translateY( 0 );
		}
	}

	&.is-with-sidebar {
		@include breakpoint( '>660px' ) {
			left: 273px;
		}
	}
}

.web-preview__backdrop {
	position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
	display: block;
	background: rgba( var( --color-neutral-0-rgb ), 0.8 );
}

.web-preview__content {
	display: flex;
	flex-direction: column;
	box-shadow: 0 0 0 1px rgba( var( --color-neutral-light-rgb ), 0.5 );
	background: var( --color-neutral-0 );
	border-radius: 4px 4px 0 0;
	position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
	margin: 0 auto;
	opacity: 0;
	transform: translateY( 80vh );
	transition: transform 0.2s ease-out,
		opacity 0.1s ease-in-out;

	@include breakpoint( '>960px' ) {
		top: 24px;
		left: 24px;
		right: 24px;
		width: calc( 100% - 46px ); /* IE11 fix */
	}
}

.web-preview__toolbar {
	height: 46px;
	background: var( --color-surface );
	border-bottom: 1px solid var( --color-neutral-10 );
	border-radius: 4px 4px 0 0;
	display: flex;
}

.web-preview__close.button {
	border-right: 1px solid var( --color-neutral-5 );
	padding: 6px 16px;
	min-width: 80px;
	color: var( --color-primary );
	border-radius: 0;

	@include breakpoint( '>960px' ) {
		padding: 6px 32px;
	}

	&:hover {
		color: var( --color-accent );
	}
}

a.web-preview__external.button {
	margin: 3px 8px;
	min-width: 120px;
	text-align: center;
}

.web-preview__edit.button {
	margin: 3px 0;
	min-width: 100px;
	text-align: center;
}

.web-preview__toolbar-actions {
	margin-left: auto;
	display: flex;
	justify-content: flex-end;

	@include breakpoint( '>960px' ) {
		// Matches __device-switcher width + margin
		// and allows the center area to flex equally
		min-width: 212px;
	}
}

.web-preview__device-switcher {
	display: flex;
	margin: 6px 0 0 12px;
	width: 200px;
}

.web-preview__url-clipboard-input {
	flex-grow: 1;
	margin: 6px 10px;
	width: auto;

	.form-text-input {
		color: var( --color-text-subtle );
		font-size: 14px;
		height: 35px;
		border-color: transparent;
		text-overflow: ellipsis;
		text-align: center;
	}

	&:hover .form-text-input:not( :focus ) {
		border-color: var( --color-neutral-10 );
	}

	.clipboard-button {
		display: none;
	}

	&:hover .clipboard-button {
		display: block;
	}
}

.web-preview__device-button {
	border-right: none;
	padding-left: 8px;
	padding-right: 8px;

	&.is-active {
		color: var( --color-neutral-70 );
	}

	@include breakpoint( '<660px' ) {
		display: none;
	}
}

.web-preview__seo-button {
	border-right: none;
	padding: 0 14px;
	height: 100%;

	&.is-active {
		color: var( --color-neutral-70 );
	}

	&.is-showing-device-switcher {
		border-left: 1px solid var( --color-neutral-10 );
		margin-left: 8px;
	}
}

.web-preview__seo-label {
	margin-left: 6px;
	vertical-align: middle;
}

.web-preview__back-to-preview-button {
	display: none;

	@include breakpoint( '<660px' ) {
		display: block;
	}
}

.web-preview__toolbar-tray {
	.button {
		margin: 4px;
		&:not( :last-child ) {
			@include breakpoint( '<660px' ) {
				display: none;
			}
		}
	}
}

.web-preview__frame {
	display: block;
	width: 100%;
	max-width: 100%;
	height: 100%;
	opacity: 0;
	transition: opacity 0.2s ease-in-out,
		max-width 0.2s ease-out;
	margin: 0 auto;
	pointer-events: none;

	.is-loaded & {
		opacity: 1;
		pointer-events: all;
	}

	.is-tablet & {
		max-width: 783px;
	}

	.is-phone & {
		max-width: 460px;
	}

	.is-seo & {
		max-width: 865px;
	}
}

.web-preview__frame-wrapper {
	position: absolute;
		top: 0;
		left: 0;
	height: 100%;
	width: 100%;

	&.is-resizable {
		background: var( --color-neutral-0 );

		.web-preview__frame {
			.is-tablet & {
				max-width: 783px;
			}

			.is-phone & {
				max-width: 460px;
			}
		}
	}
}

.web-preview__placeholder {
	position: relative;
	width: 100%;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	flex: 1;
}

.web-preview__inner {
	height: 100%;
	display: flex;
	flex-direction: column;
	position: relative;
}

.web-preview__loading-message-wrapper {
	display: flex;
	justify-content: center;
	flex-direction: column;
	position: absolute;
	height: 100%;
	width: 100%;
	z-index: z-index( 'root', '.web-preview__loading-message-wrapper' );
	text-align: center;
}

.web-preview__loading-message {
	color: var( --color-text-subtle );
	font-size: 16px;
}

.web-preview__loading-message strong {
	color: var( --color-text-subtle );
	display: block;
	font-size: 24px;
	margin-bottom: 5px;
}

.web-preview__inner .spinner-line {
	position: absolute;
		top: 22px;
	width: 100%;
	z-index: z-index( 'root', '.web-preview__inner .spinner-line' );
}

.web-preview__inner .spinner-line {
	position: absolute;
		top: 22px;
	width: 100%;
	z-index: z-index( 'root', '.web-preview__inner .spinner-line' );
}
